<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top"><span style="display: none;">
        加载中...</span> <span>设置登录密码</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="{:U('Index/verifySafePwd')}" class="iconfont back" style=""></a>
    </header>
    <div data-v-23a19762="" class="main" s="[object Object]">
        <input type="hidden" name="id" id="uid" value="{$id}">
        <table data-v-23a19762="">
            <tbody data-v-23a19762="">
            <tr data-v-23a19762="">
                <td data-v-23a19762="">登录密码</td>
                <td data-v-23a19762="">
                    <input data-v-23a19762="" id="pass1" type="password" tag="登录密码" placeholder="请输入登录密码" class="va58" name="Password">
                </td>
            </tr>
            <tr data-v-23a19762="">
                <td data-v-23a19762="">确认密码</td>
                <td data-v-23a19762="">
                    <input data-v-23a19762="" id="pass2"  type="password" tag="确认密码" placeholder="请再次输入密码" class="va58" name="checkPassword">
                </td>
            </tr>
            <tr data-v-23a19762=""></tr>
            </tbody>
        </table>
        <div data-v-23a19762="" class="loginBtn BTN">
            <a data-v-23a19762="" onclick="sav()">确定</a>
        </div>
    </div>
    <div id="pass1_kong" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">·密码不能为空·</div>
                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <div id="pass2_kong" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">·确认密码不能为空·</div>
                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <div id="weishu" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">·密码必须是6~20位·</div>
                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <div id="buyiyang" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">·两次输入的密码不一致·</div>
                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>


</div>
</body>
</html>

<script>
    $(".layermbtn").click(function () {
        $(".layermbox").hide();
        window.location.href = "";
    });
    function sav() {
        var id = $("#uid").val();
        var pass1 = $("#pass1").val();
        var pass2 = $("#pass2").val();
        if (pass1 == '') {
            $("#pass1_kong").show();
            return false;
        }
        if (pass1.length < 6 || pass1.length > 20) {
            $("#weishu").show();
            return false;
        }
        if (pass2 == '') {
            $("#pass2_kong").show();
            return false;
        }

        if (pass1 != pass2) {
            $("#buyiyang").show();
            return false;
        }

        $.ajax({
            type: "POST",
            url: "{:U('Index/verifyPwd2')}",
            data: {'pass': pass1, 'id': id},
            success: function (dat) {
                if (dat == 1) {
                    window.location.href = "/Index/login/";
                }
            }
        });

    }
</script>